package com.mrx.commons.util.redis.adapter;

import org.springframework.data.redis.connection.BitFieldSubCommands;
import org.springframework.data.redis.connection.DataType;
import org.springframework.data.redis.core.*;
import org.springframework.data.redis.core.query.SortQuery;
import org.springframework.data.redis.core.script.RedisScript;
import org.springframework.data.redis.core.types.RedisClientInfo;
import org.springframework.data.redis.hash.HashMapper;
import org.springframework.data.redis.serializer.RedisSerializer;
import org.springframework.lang.NonNull;

import java.io.Closeable;
import java.time.Duration;
import java.time.Instant;
import java.util.*;
import java.util.concurrent.TimeUnit;

/**
 * @author : 肖康宁
 * @since : 2022-12-09 10:39
 **/
public abstract class FakeOperationsAdapter<K, V> implements ValueOperations<K, V>, RedisOperations<K, V> {

    public FakeOperationsAdapter() {
        super();
    }

    @Override
    public <T> T execute(@NonNull RedisCallback<T> action) {
        throw new UnsupportedOperationException("暂未实现");
    }

    @Override
    public <T> T execute(@NonNull SessionCallback<T> session) {
        throw new UnsupportedOperationException("暂未实现");
    }

    @NonNull
    @Override
    public List<Object> executePipelined(@NonNull RedisCallback<?> action) {
        throw new UnsupportedOperationException("暂未实现");
    }

    @NonNull
    @Override
    public List<Object> executePipelined(@NonNull RedisCallback<?> action, @NonNull RedisSerializer<?> resultSerializer) {
        throw new UnsupportedOperationException("暂未实现");
    }

    @NonNull
    @Override
    public List<Object> executePipelined(@NonNull SessionCallback<?> session) {
        throw new UnsupportedOperationException("暂未实现");
    }

    @NonNull
    @Override
    public List<Object> executePipelined(@NonNull SessionCallback<?> session, @NonNull RedisSerializer<?> resultSerializer) {
        throw new UnsupportedOperationException("暂未实现");
    }

    @Override
    public String toString() {
        return super.toString();
    }

    @Override
    public <T> T execute(@NonNull RedisScript<T> script, @NonNull List<K> keys, @NonNull Object... args) {
        throw new UnsupportedOperationException("暂未实现");
    }

    @Override
    public <T> T execute(@NonNull RedisScript<T> script, @NonNull RedisSerializer<?> argsSerializer, @NonNull RedisSerializer<T> resultSerializer, @NonNull List<K> keys, @NonNull Object... args) {
        throw new UnsupportedOperationException("暂未实现");
    }

    @Override
    public <T extends Closeable> T executeWithStickyConnection(@NonNull RedisCallback<T> callback) {
        throw new UnsupportedOperationException("暂未实现");
    }

    @Override
    public Boolean copy(@NonNull K sourceKey, @NonNull K targetKey, boolean replace) {
        throw new UnsupportedOperationException("暂未实现");
    }

    @Override
    public Boolean hasKey(@NonNull K key) {
        throw new UnsupportedOperationException("暂未实现");
    }

    @Override
    public Long countExistingKeys(@NonNull Collection<K> keys) {
        throw new UnsupportedOperationException("暂未实现");
    }

    @Override
    public Boolean delete(@NonNull K key) {
        throw new UnsupportedOperationException("暂未实现");
    }

    @Override
    public Long delete(@NonNull Collection<K> keys) {
        throw new UnsupportedOperationException("暂未实现");
    }

    @Override
    public Boolean unlink(@NonNull K key) {
        throw new UnsupportedOperationException("暂未实现");
    }

    @Override
    public Long unlink(@NonNull Collection<K> keys) {
        throw new UnsupportedOperationException("暂未实现");
    }

    @Override
    public DataType type(@NonNull K key) {
        throw new UnsupportedOperationException("暂未实现");
    }

    @Override
    public Set<K> keys(@NonNull K pattern) {
        throw new UnsupportedOperationException("暂未实现");
    }

    @NonNull
    @Override
    public Cursor<K> scan(@NonNull ScanOptions options) {
        throw new UnsupportedOperationException("暂未实现");
    }

    @Override
    public K randomKey() {
        throw new UnsupportedOperationException("暂未实现");
    }

    @Override
    public void rename(@NonNull K oldKey, @NonNull K newKey) {

    }

    @Override
    public Boolean renameIfAbsent(@NonNull K oldKey, @NonNull K newKey) {
        throw new UnsupportedOperationException("暂未实现");
    }

    @Override
    public Boolean expire(@NonNull K key, long timeout, @NonNull TimeUnit unit) {
        throw new UnsupportedOperationException("暂未实现");
    }

    @Override
    public Boolean expire(@NonNull K key, @NonNull Duration timeout) {
        return RedisOperations.super.expire(key, timeout);
    }

    @Override
    public Boolean expireAt(@NonNull K key, @NonNull Date date) {
        throw new UnsupportedOperationException("暂未实现");
    }

    @Override
    public Boolean expireAt(@NonNull K key, @NonNull Instant expireAt) {
        return RedisOperations.super.expireAt(key, expireAt);
    }

    @Override
    public Boolean persist(@NonNull K key) {
        throw new UnsupportedOperationException("暂未实现");
    }

    @Override
    public Boolean move(@NonNull K key, int dbIndex) {
        throw new UnsupportedOperationException("暂未实现");
    }

    @Override
    public byte[] dump(@NonNull K key) {
        return new byte[0];
    }

    @Override
    public void restore(@NonNull K key, @NonNull byte[] value, long timeToLive, @NonNull TimeUnit unit) {
        RedisOperations.super.restore(key, value, timeToLive, unit);
    }

    @Override
    public void restore(@NonNull K key, @NonNull byte[] value, long timeToLive, @NonNull TimeUnit unit, boolean replace) {

    }

    @Override
    public Long getExpire(@NonNull K key) {
        throw new UnsupportedOperationException("暂未实现");
    }

    @Override
    public Long getExpire(@NonNull K key, @NonNull TimeUnit timeUnit) {
        throw new UnsupportedOperationException("暂未实现");
    }

    @Override
    public List<V> sort(@NonNull SortQuery<K> query) {
        throw new UnsupportedOperationException("暂未实现");
    }

    @Override
    public <T> List<T> sort(@NonNull SortQuery<K> query, @NonNull RedisSerializer<T> resultSerializer) {
        throw new UnsupportedOperationException("暂未实现");
    }

    @Override
    public <T> List<T> sort(@NonNull SortQuery<K> query, @NonNull BulkMapper<T, V> bulkMapper) {
        throw new UnsupportedOperationException("暂未实现");
    }

    @Override
    public <T, S> List<T> sort(@NonNull SortQuery<K> query, @NonNull BulkMapper<T, S> bulkMapper, @NonNull RedisSerializer<S> resultSerializer) {
        throw new UnsupportedOperationException("暂未实现");
    }

    @Override
    public Long sort(@NonNull SortQuery<K> query, @NonNull K storeKey) {
        throw new UnsupportedOperationException("暂未实现");
    }

    @Override
    public void watch(@NonNull K key) {

    }

    @Override
    public void watch(@NonNull Collection<K> keys) {

    }

    @NonNull
    @Override
    public List<Object> exec() {
        throw new UnsupportedOperationException("暂未实现");
    }

    @NonNull
    @Override
    public List<Object> exec(@NonNull RedisSerializer<?> valueSerializer) {
        throw new UnsupportedOperationException("暂未实现");
    }

    @Override
    public List<RedisClientInfo> getClientList() {
        throw new UnsupportedOperationException("暂未实现");
    }

    @Override
    public void unwatch() {

    }

    @Override
    public void multi() {

    }

    @Override
    public void discard() {

    }

    @Override
    public void killClient(@NonNull String host, int port) {

    }

    @Override
    public void slaveOf(@NonNull String host, int port) {

    }

    @Override
    public void convertAndSend(@NonNull String destination, @NonNull Object message) {

    }

    @NonNull
    @Override
    public ClusterOperations<K, V> opsForCluster() {
        throw new UnsupportedOperationException("暂未实现");
    }

    @NonNull
    @Override
    public GeoOperations<K, V> opsForGeo() {
        throw new UnsupportedOperationException("暂未实现");
    }

    @Override
    public void slaveOfNoOne() {

    }

    @NonNull
    @Override
    public BoundGeoOperations<K, V> boundGeoOps(@NonNull K key) {
        throw new UnsupportedOperationException("暂未实现");
    }

    @NonNull
    @Override
    public <HK, HV> HashOperations<K, HK, HV> opsForHash() {
        throw new UnsupportedOperationException("暂未实现");
    }

    @NonNull
    @Override
    public <HK, HV> BoundHashOperations<K, HK, HV> boundHashOps(@NonNull K key) {
        throw new UnsupportedOperationException("暂未实现");
    }

    @NonNull
    @Override
    public HyperLogLogOperations<K, V> opsForHyperLogLog() {
        throw new UnsupportedOperationException("暂未实现");
    }

    @NonNull
    @Override
    public ListOperations<K, V> opsForList() {
        throw new UnsupportedOperationException("暂未实现");
    }

    @NonNull
    @Override
    public BoundListOperations<K, V> boundListOps(@NonNull K key) {
        throw new UnsupportedOperationException("暂未实现");
    }

    @NonNull
    @Override
    public SetOperations<K, V> opsForSet() {
        throw new UnsupportedOperationException("暂未实现");
    }

    @NonNull
    @Override
    public BoundSetOperations<K, V> boundSetOps(@NonNull K key) {
        throw new UnsupportedOperationException("暂未实现");
    }

    @NonNull
    @Override
    public <HK, HV> StreamOperations<K, HK, HV> opsForStream() {
        throw new UnsupportedOperationException("暂未实现");
    }

    @NonNull
    @Override
    public <HK, HV> StreamOperations<K, HK, HV> opsForStream(@NonNull HashMapper<? super K, ? super HK, ? super HV> hashMapper) {
        throw new UnsupportedOperationException("暂未实现");
    }

    @NonNull
    @Override
    public <HK, HV> BoundStreamOperations<K, HK, HV> boundStreamOps(@NonNull K key) {
        throw new UnsupportedOperationException("暂未实现");
    }

    @NonNull
    @Override
    public ValueOperations<K, V> opsForValue() {
        throw new UnsupportedOperationException("暂未实现");
    }

    @NonNull
    @Override
    public BoundValueOperations<K, V> boundValueOps(@NonNull K key) {
        throw new UnsupportedOperationException("暂未实现");
    }

    @NonNull
    @Override
    public ZSetOperations<K, V> opsForZSet() {
        throw new UnsupportedOperationException("暂未实现");
    }

    @NonNull
    @Override
    public BoundZSetOperations<K, V> boundZSetOps(@NonNull K key) {
        throw new UnsupportedOperationException("暂未实现");
    }

    @NonNull
    @Override
    public RedisSerializer<?> getKeySerializer() {
        throw new UnsupportedOperationException("暂未实现");
    }

    @NonNull
    @Override
    public RedisSerializer<?> getValueSerializer() {
        throw new UnsupportedOperationException("暂未实现");
    }

    @NonNull
    @Override
    public RedisSerializer<?> getHashKeySerializer() {
        throw new UnsupportedOperationException("暂未实现");
    }

    @NonNull
    @Override
    public RedisSerializer<?> getHashValueSerializer() {
        throw new UnsupportedOperationException("暂未实现");
    }

    @Override
    public void set(@NonNull K key, @NonNull V value) {

    }

    @Override
    public void set(@NonNull K key, @NonNull V value, long timeout, @NonNull TimeUnit unit) {

    }

    @Override
    public void set(@NonNull K key, @NonNull V value, @NonNull Duration timeout) {
        ValueOperations.super.set(key, value, timeout);
    }

    @Override
    public Boolean setIfAbsent(@NonNull K key, @NonNull V value) {
        throw new UnsupportedOperationException("暂未实现");
    }

    @Override
    public Boolean setIfAbsent(@NonNull K key, @NonNull V value, long timeout, @NonNull TimeUnit unit) {
        throw new UnsupportedOperationException("暂未实现");
    }

    @Override
    public Boolean setIfAbsent(@NonNull K key, @NonNull V value, @NonNull Duration timeout) {
        return ValueOperations.super.setIfAbsent(key, value, timeout);
    }

    @Override
    public Boolean setIfPresent(@NonNull K key, @NonNull V value) {
        throw new UnsupportedOperationException("暂未实现");
    }

    @Override
    public Boolean setIfPresent(@NonNull K key, @NonNull V value, long timeout, @NonNull TimeUnit unit) {
        throw new UnsupportedOperationException("暂未实现");
    }

    @Override
    public Boolean setIfPresent(@NonNull K key, @NonNull V value, @NonNull Duration timeout) {
        return ValueOperations.super.setIfPresent(key, value, timeout);
    }

    @Override
    public void multiSet(@NonNull Map<? extends K, ? extends V> map) {

    }

    @Override
    public Boolean multiSetIfAbsent(@NonNull Map<? extends K, ? extends V> map) {
        throw new UnsupportedOperationException("暂未实现");
    }

    @Override
    public V get(@NonNull Object key) {
        throw new UnsupportedOperationException("暂未实现");
    }

    @Override
    public V getAndDelete(@NonNull K key) {
        throw new UnsupportedOperationException("暂未实现");
    }

    @Override
    public V getAndExpire(@NonNull K key, long timeout, @NonNull TimeUnit unit) {
        throw new UnsupportedOperationException("暂未实现");
    }

    @Override
    public V getAndExpire(@NonNull K key, @NonNull Duration timeout) {
        throw new UnsupportedOperationException("暂未实现");
    }

    @Override
    public V getAndPersist(@NonNull K key) {
        throw new UnsupportedOperationException("暂未实现");
    }

    @Override
    public V getAndSet(@NonNull K key, @NonNull V value) {
        throw new UnsupportedOperationException("暂未实现");
    }

    @Override
    public List<V> multiGet(@NonNull Collection<K> keys) {
        throw new UnsupportedOperationException("暂未实现");
    }

    @Override
    public Long increment(@NonNull K key) {
        throw new UnsupportedOperationException("暂未实现");
    }

    @Override
    public Long increment(@NonNull K key, long delta) {
        throw new UnsupportedOperationException("暂未实现");
    }

    @Override
    public Double increment(@NonNull K key, double delta) {
        throw new UnsupportedOperationException("暂未实现");
    }

    @Override
    public Long decrement(@NonNull K key) {
        throw new UnsupportedOperationException("暂未实现");
    }

    @Override
    public Long decrement(@NonNull K key, long delta) {
        throw new UnsupportedOperationException("暂未实现");
    }

    @Override
    public Integer append(@NonNull K key, @NonNull String value) {
        throw new UnsupportedOperationException("暂未实现");
    }

    @Override
    public String get(@NonNull K key, long start, long end) {
        throw new UnsupportedOperationException("暂未实现");
    }

    @Override
    public void set(@NonNull K key, @NonNull V value, long offset) {

    }

    @Override
    public Long size(@NonNull K key) {
        throw new UnsupportedOperationException("暂未实现");
    }

    @Override
    public Boolean setBit(@NonNull K key, long offset, boolean value) {
        throw new UnsupportedOperationException("暂未实现");
    }

    @Override
    public Boolean getBit(@NonNull K key, long offset) {
        throw new UnsupportedOperationException("暂未实现");
    }

    @Override
    public List<Long> bitField(@NonNull K key, @NonNull BitFieldSubCommands subCommands) {
        throw new UnsupportedOperationException("暂未实现");
    }

    @NonNull
    @Override
    public RedisOperations<K, V> getOperations() {
        throw new UnsupportedOperationException("暂未实现");
    }

}
